<template>
	
	<div id="contentBox" >
		<transition name="fade" >
		<div id="tableBox" style="margin:25px 25px 0;" v-show="!parent">
			<el-table :data="tableData" border  >
				<el-table-column type="expand">
			      <template scope="props" >
			        <el-form label-position="left" inline class="demo-table-expand" v-if="props.row.childrenTemplateList.length>0">
			          <div v-for="(item,index) in props.row.childrenTemplateList">
			          	  <el-form-item :label="'子节点流程名称'+(index+1)+':'" >
				            <span >{{ item.workflowNodeTerm }}</span>
				          </el-form-item>
			          </div>
			        </el-form>
			        <span v-else>暂无子节点</span>
			      </template>

			    </el-table-column>
			    <el-table-column label="序号" width="80">
			      <template scope="scope">
			        <span >{{ scope.row.sortNumber }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="流程名称" width="180">
			      <template scope="scope">
			        <span >{{ scope.row.workflowNodeTerm }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="节点名称" width="180">
			      <template scope="scope">
			        <span >{{ scope.row.workflowNodeName }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="退回节点" width="180">
			      <template scope="scope">
			        <span >{{ scope.row.workflowNodeReturnStatusVO }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="节点角色" :min-width="120">
			      <template scope="scope">
			        <span v-for="(item,index) in scope.row.roleList" ><el-tag :type="(index%2==0)?'primary':'success'">{{item.roleName}}</el-tag></span>
			      </template>
			    </el-table-column>
			    <el-table-column label="操作" width="190">
			      <template scope="scope">
			      	<el-button size="small" @click="handleEdit(scope.$index,scope.row)">编辑</el-button>
			      	<el-button size="small" v-show="scope.$index!=0" @click="handleMove(scope.$index, scope.row)" >上移</el-button>
			      	<el-button size="small" type="danger" @click="handleDel(scope.$index, scope.row)" >删除</el-button>
			      </template>
			    </el-table-column>
			</el-table>
	        <el-dialog  title="消息流程配置" v-if="dialogSendData.dialogFormVisible" :visible.sync="dialogSendData.dialogFormVisible"  :lock-scroll='false' top=5% :close-on-click-modal="false"  >
				<dialogForm :dialogSendData="dialogSendData" :tableData="tableData" v-on:refreshTableData="seachData()" :workflowStatus="workflowStatus"></dialogForm>
			</el-dialog>
            <div class="block" style="text-align: center;margin-top: 15px;position:relative;">
            	<el-button  style="position:absolute;right:105px;top:0;" @click="retrunParentList">返 回</el-button>
			    <el-button  style="position:absolute;right:25px;top:0;" type="primary" @click="handleEdit()">添 加</el-button>
			</div>
	    </div>
	    </transition>
	    <transition name="fade">
		    <div id="contentBox1" v-show="parent">
				<div id="tableBox1" style="margin:25px 25px 0;" >
					<el-table :data="tableData1" border  >
						
					    <el-table-column label="流程名称" >
					      <template scope="scope">
					        <span >{{ scope.row.workflowSubjectName }}</span>
					      </template>
					    </el-table-column>
					   
					    <el-table-column label="操作" width="200">
					      <template scope="scope">
					      	<el-button size="small" @click="handleEdit1(scope.$index,scope.row)">修改</el-button>
					      	<el-button size="small" @click="handlePush1(scope.$index,scope.row)">配置流程</el-button>
					      </template>
					    </el-table-column>
					</el-table>	       
			    </div>
			    <el-dialog  title="消息流程编辑" v-if="dialogSendData1.dialogFormVisible" :visible.sync="dialogSendData1.dialogFormVisible"  :lock-scroll='false' top=15% :close-on-click-modal="false"  >
			        <el-form :model="dialogForm1" :rules="rules1" ref="dialogForm1" :label-width="formLabelWidth">
					  	<el-form-item label="流程名称"  prop="status">
					        <el-select v-model="dialogForm1.status" placeholder="请选择流程名称" :disabled="!dialogSendData1.isAdd">    
						    	<el-option v-for="(item, index) in statusMap" :label="item" :value="index-0" :key="index"></el-option>
							</el-select>
					    </el-form-item>
					    <div  style="text-align:right;margin-top:15px;">
							<el-button @click="retrunParentList1()">返 回</el-button>
							<el-button type="primary" @click="submitParent1('dialogForm1')">确 认</el-button>
						</div>
					</el-form>
			    </el-dialog>
			    <div class="block" style="text-align: center;margin-top: 15px;position:relative;">
				    <el-button  style="position:absolute;right:25px;top:0;" type="primary" @click="handleEdit1()">添 加</el-button>
				</div>
			</div>
	    </transition>
	</div>
</template>
<script src="./index.js">

</script>
<style scoped lang="stylus" rel="styleheet/stylus">
	@import './index.styl';
</style>